﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace NPMonitor.DataModel
{
    [Serializable]
    [Table("Jobs")]
    public class JobDefinition
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int? JobId { get; set; }

        [Required]
        public string JobName { get; set; }

        public string Desc { get; set; }

        [Required]
        public string FileName { get; set; }

        public string Version { get; set; }

        [NotMapped]
        public Version FileVersion
        {
            get
            {
                return new Version(this.Version);
            }
            set
            {
                this.Version = value.ToString();
            }
        }

        public string TypeName { get; set; }

        public string CreateBy { get; set; }

        public DateTime? CreateTime { get; set; }

        public string UpdateBy { get; set; }

        public DateTime? UpdateTime { get; set; }
    }
}
